package com.likeycy.my.entity;

/**
 * @ClassName: Person
 * @Description: Person实体
 * @Author: sodagreen
 * @Date: 2021/3/5 13:44
 * @Version: 1.0
 */
public class Person implements Comparable<Person>{
    private String name;
    private int age;

    public Person(int age, String name){
        this.age = age;
        this.name = name;
    }

    public Person(int age){
        this.age = age;
    }

    public Person() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return this.age + "";
    }

    @Override
    public int compareTo(Person o) {
        return this.age - o.age;
    }
}
